import { createRequest } from '/@/api/service';
const module = 'ib/maintain/v1/AppPlanTaskApi/';
/**
 * 移动端计划列表
 */
function APP_PLAN_TASK_LIST_QUERY(
  data: AppPlanTaskApi.AppPlanTaskListQueryReq,
  header: object = {},
): Promise<AppPlanTaskApi.AppPlanTaskListQueryResp> {
  return createRequest(
    `${process.env.APP_API_URL}${module}queryAppPlanTaskList`,
    data,
    header,
    'POST',
  );
}
/**
 * @description 移动端计划详情
 * @param data 请求数据
 * @param header header数据
 * @returns 返回实体
 */
function APP_PLAN_TASK_DETAIL_QUERY(
  data: AppPlanTaskApi.AppPlanTaskDetailQueryReq,
  header: object = {},
): Promise<AppPlanTaskApi.AppPlanTaskDetailQueryResp> {
  return createRequest(
    `${process.env.APP_API_URL}${module}queryAppPlanTaskDetail`,
    data,
    header,
    'POST',
  );
}

/**
 * 移动端任务列表
 */
function APP_PLAN_TASK_ASSET_LIST_QUERY(
  data: AppPlanTaskApi.AppPlanTaskAssetListQueryReq,
  header: object = {},
): Promise<AppPlanTaskApi.AppPlanTaskAssetListQueryResp> {
  return createRequest(
    `${process.env.APP_API_URL}${module}queryAppPlanTaskAssetList`,
    data,
    header,
    'POST',
  );
}

/**
 * 移动端任务详情
 * @param data
 * @param header
 * @returns
 */
function APP_PLAN_TASK_ASSET_DETAIL_QUERY(
  data: AppPlanTaskApi.AppPlanTaskAssetDetailQueryReq,
  header: object = {},
): Promise<AppPlanTaskApi.AppPlanTaskAssetDetailQueryResp> {
  return createRequest(
    `${process.env.APP_API_URL}${module}queryAppPlanTaskAssetDetail`,
    data,
    header,
    'POST',
  );
}

/**
 * 移动端处理任务
 * @param data
 * @param header
 * @returns
 */
function HANDLE_APP_TASK(
  data: AppPlanTaskApi.HandleAppTaskReq,
  header: object = {},
): Promise<AppPlanTaskApi.HandleAppTaskResp> {
  return createRequest(`${process.env.APP_API_URL}${module}handleAppTask`, data, header, 'POST');
}

/**
 * 转派
 * @param data
 * @param header
 * @returns
 */
function FORWARD_APP_TASK(
  data: AppPlanTaskApi.ForwardAppTaskReq,
  header: object = {},
): Promise<AppPlanTaskApi.ForwardAppTaskResp> {
  return createRequest(`${process.env.APP_API_URL}${module}forwardAppTask`, data, header, 'POST');
}

/**
 * 故障上报，此接口在故障工单新增后，提交新增工单id和编号用于标记此任务已上报工单
 * @param data 请求参数
 * @param header 请求头
 * @returns 实体
 */
function UPLOAD_APP_WORK_ORDER_BY_TASK_ASSET(
  data: AppPlanTaskApi.UploadAppWorkOrderByTaskAssetReq,
  header: object = {},
): Promise<AppPlanTaskApi.UploadAppWorkOrderByTaskAssetResp> {
  return createRequest(
    `${process.env.APP_API_URL}${module}uploadAppWorkOrderByTaskAsset`,
    data,
    header,
    'POST',
  );
}

export {
  APP_PLAN_TASK_LIST_QUERY,
  APP_PLAN_TASK_ASSET_LIST_QUERY,
  APP_PLAN_TASK_ASSET_DETAIL_QUERY,
  HANDLE_APP_TASK,
  FORWARD_APP_TASK,
  APP_PLAN_TASK_DETAIL_QUERY,
  UPLOAD_APP_WORK_ORDER_BY_TASK_ASSET,
};
